package com.imooc.luckymoney.entity;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

@Entity
public class Consumer {
    @Id
    @NotNull(message = "id不能为空")
    Integer id;

    @NotBlank(message = "领取者不能为空")
    String consumer;

    public Consumer(@NotBlank(message = "id不能为空")
                    @Pattern(regexp = "-?[0-9]+(\\.[0-9]+)?",message = "id输入有误") Integer id,
                    @NotBlank(message = "领取者不能为空") String consumer) {
        this.id = id;
        this.consumer = consumer;
    }
    public Consumer(){

    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getConsumer() {
        return consumer;
    }

    public void setConsumer(String consumer) {
        this.consumer = consumer;
    }
}
